package com.chhlz.module.base.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="consumption_pattern")
@DynamicInsert
@DynamicUpdate
public class ConsumptionPattern implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 4505996043726140376L;
	private int cpId;
	private String cpName;
	private String description;
	
	@Id
	@Column(name = "cp_id", nullable = false, length = 11)
	@GeneratedValue(generator = "generator") 
	@GenericGenerator(name = "generator", strategy = "increment") 
	public int getCpId() {
		return cpId;
	}
	public void setCpId(int cpId) {
		this.cpId = cpId;
	}
	
	@Column(name = "cp_name", nullable = false, length = 15)
	public String getCpName() {
		return cpName;
	}
	public void setCpName(String cpName) {
		this.cpName = cpName;
	}
	
	@Column(name = "description")
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	@Override
	public String toString() {
		return "ConsumptionPattern [cpId=" + cpId + ", cpName=" + cpName
				+ ", description=" + description + "]";
	}

}
